import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import StudentClockedIn from "@/views/StudentClockedIn"
import StdNotClockedIn from "@/views/StdNotClockedIn"
import Student from "@/views/Student"
import Clock from "@/views/Clock"
import Personal from "@/views/Personal"
import UpdateStudent from "@/views/UpdateStudent"
import UpdatePassword from "@/views/UpdatePassword"
import ClockedHistory from "@/views/ClockedHistory"
import AdminIndex from "@/views/AdminIndex"
import StudentIndex from "@/views/StudentIndex"
import App from "../App";
import Login from "@/views/Login"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: "Login",
      component: Login,
    },
    {
      path: '/studentClockedIn',
      name: '打卡',
      component: AdminIndex,
      children: [
        {
          path: '/student',
          name: "学生名单",
          component: Student
        },
        {
          path: '/studentClockedIn',
          name: "已打卡",
          component: StudentClockedIn
        },
        {
          path: '/stdNotClockedIn',
          name: "未打卡",
          component: StdNotClockedIn
        }
      ]
    },
    {
      path: '/studentIndex',
      name: '菜单一',
      component: StudentIndex,
      redirect: "/personal",
      children: [
        {
          path: '/personal',
          name: "个人信息",
          component: Personal,
          meta: {
            keepAlive: true
          }
        },
        {
          path: '/clockedHistory',
          name: "历史打卡",
          component: ClockedHistory,
          meta: {
            keepAlive: true
          }
        }
      ],
    },
    {
      path: '/clock',
      name: "打卡",
      component: Clock,
      meta: {
        keepAlive: true
      }
    },
    {
      path: '/updateStudent',
      name: "修改用户",
      component: UpdateStudent
    },
    {
      path: '/updatePassword',
      name: "修改密码",
      component: UpdatePassword
    }
  ],
  mode:"history"
})
